Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#2738) Move setup module to install .Net 4.8 #2933

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

TheCakeIsNaOH
Copy link
Member

@TheCakeIsNaOH TheCakeIsNaOH commented Dec 13, 2022

Description Of Changes

This moves the setup module used during install and upgrade to
check for and install .Net 4.8 instead of .Net 4.0

The timing of the check/install is moved to before the Chocolatey
installation directory is created. This allows for re-running the
install.ps1 script if a reboot is required without needing a manual
cleanup of the partial installation.

This also adds a check for the other reboot required exit code of
1641, and throws the install/upgrade if the installer requires
a reboot.

Motivation and Context

As Chocolatey CLI is being moved to .Net 4.8, it requires insuring that the required framework is installed.

Testing

Testing on Server 2012 R2:

  • Upgraded from Chocolatey CLI 1.2.1 to a built nupkg from this PR. It installed .net 4.8 and threw as a reboot was required. After a reboot, a second attempt at an upgrade worked.
  • Installed .net 4.8, rebooted, and upgraded from Chocolatey CLI 1.2.1 to a built nupkg from this PR. It upgraded without issues.
  • Installed .net 4.8, did not reboot, and upgraded from Chocolatey CLI 1.2.1 to a built nupkg from this PR. It installed .net 4.8 (since the installer does not detect a previous install until after a reboot) and threw as a reboot was required (as per the exit code). After a reboot, a second attempt at an upgrade worked.

Testing on clean Windows 7 SP1:

  • Installed the built nupkg from this PR via a local copy of the install.ps1 script. It installed .net 4.8, did not require a reboot, and installed without issues. Local path to the nupkg specified by setting $env:ChocolateyDownloadUrl
  • Installed Chocolatey 1.2.1, rebooted, and Upgraded from Chocolatey CLI 1.2.1 to a built nupkg from this PR. It installed .net 4.8 and threw as a reboot was required. After a reboot, a second attempt at an upgrade worked.

Operating Systems Testing

  • Windows Server 2012 R2
  • Windows 7 SP1

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

Part of #2738
https://app.clickup.com/t/20540031/PROJ-405

@corbob
Copy link
Member

corbob commented Dec 14, 2022

One thing to be aware of before merging this PR: Currently our Test Kitchen environment has Windows Server 2016 and 2019 without .Net 4.8. Both of these Operating Systems require a restart when installing .Net 4.8. This means that the converge step will fail until our Test Kitchen environment is updated.

@gep13
Copy link
Member

gep13 commented Dec 15, 2022

@corbob said...
This means that the converge step will fail until our Test Kitchen environment is updated.

What sort of effort is required here?

Adding @pauby for visibility here.

@choco-bot
Copy link

@pauby
Copy link
Member

pauby commented Dec 21, 2022

As I understand it, we need to get the AMI's used by Test Kitchen updated to have installed .NET 4.8. Let me pick this up and get it sorted.

Moving this to draft in the meantime.

@pauby pauby marked this pull request as draft December 21, 2022 14:28
@gep13 gep13 marked this pull request as ready for review January 6, 2023 10:45
@gep13
Copy link
Member

gep13 commented Jan 6, 2023

As we have found out, the images being used already have .NET 4.8 installed on them, so we should be in a position to continue with this PR.

This moves the setup module used during install and upgrade to
check for and install .Net 4.8 instead of .Net 4.0

The timing of the check/install is moved to before the Chocolatey
installation directory is created. This allows for re-running the
install.ps1 script if a reboot is required without needing a manual
cleanup of the partial installation.

This also adds a check for the other reboot required exit code of
1641, and throws the install/upgrade if the installer requires
a reboot.
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gep13 gep13 merged commit b807315 into chocolatey:develop Jan 6, 2023
@TheCakeIsNaOH TheCakeIsNaOH deleted the netfx-install branch January 6, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants